<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/resource/common/taglib.jspf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>添加</title>
<%@include file="/resource/common/jquery.jspf"%>
<%@include file="/resource/common/commonCss.jspf"%>
<%@include file="/resource/common/bootstrap.jspf"%>
<%@include file="/resource/common/validate.jspf"%>
<%@include file="/resource/common/kindeditor.jspf"%>
<link rel="stylesheet" href="${ctxStatic}/plugins/upload/image.css" type="text/css" media="screen" />
<script type="text/javascript" src="${ctxStatic }/js/system/asyncDoSubmitForm.js"></script>
<script type="text/javascript" src="${ctxStatic }/plugins/upload/uploadImageUtils.js"></script>

</head>
<body>
	<div id="body-wrapper">
		<div id="main-content">
			<div class="content-box" >
				<div class="content-box-content">
					<div class="tab-content default-tab" id="tab1">
						<fieldset>
							<input type="hidden" id="asyncResult" name="asyncResult" value="-1" /> 
							<input type="hidden" id="asyncResultData" name="asyncResultData" value="-1" /> 
							<input type="hidden" id="asyncResultError" name="asyncResultError" value="-1" />
							<form:form id="inputForm" name="form1" class="form-horizontal" method="post" action="addWebExpo.do" modelAttribute="WebExpo">
								<div class="row">
									<div class="col-md-6 col-sm-6 col-xs-6" >
										<input type="hidden" id="id" name="id" value="${entity.id}" /> 
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">展会类别:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<select name="type" id="type" class="form-control input-sm">
													<option value="1" <c:if test="${entity.type==1 }">selected="selected"</c:if>>历届展会</option>
													<option value="2" <c:if test="${entity.type==2 }">selected="selected"</c:if>>最近展会</option>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">展会名称:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.title}" name="title" id="title"  placeholder="展会名称"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">报名电话:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.activityPhone}" name="activityPhone" id="activityPhone"  placeholder="报名电话"/>
											</div>
										</div>
									
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">活动时间:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.activityTime}" name="activityTime" id="activityTime"  placeholder="活动时间"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">活动地址:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.activityAddress}" name="activityAddress" id="activityAddress"  placeholder="活动地址"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">活动URL:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.activityUrl}" name="activityUrl" id="activityUrl"  placeholder="活动URL"/>
											</div>
										</div>

										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">是否开启:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<select name="status" id="status" class="form-control input-sm">
													<option value="true" <c:if test="${entity.status==true }">selected="selected"</c:if>>开启</option>
													<option value="false" <c:if test="${entity.status==false }">selected="selected"</c:if>>关闭</option>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">是否推荐:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<select name="isRecommend" id="isRecommend" class="form-control input-sm">
													<option value="true" <c:if test="${entity.isRecommend==true }">selected="selected"</c:if>>是</option>
													<option value="false" <c:if test="${entity.isRecommend==false }">selected="selected"</c:if>>否</option>
												</select>
											</div>
										</div>




									</div>
									<div class="col-md-6 col-sm-6 col-xs-6" >

										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">图片：</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="hidden" id="photo" name="photo" value="${entity.photo }"/>
												<input type="hidden" id="filedata" name="filedata" />
												<input type="hidden" id="fileext" name="fileext" />
												<div id="uploadPreview" class="uploadPreview">
													5M大小以内
												</div>
											</div>
										</div>
										<div class="form-group form-group-sm">
											<label for="formGroupInputSmall" class="col-md-2 col-sm-2 col-xs-2 control-label"></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input id="uploadImage" type="file" name="photoimage" class="fimg1" />
											</div>
										</div>
										<div  style="color: red;text-align: center;margin-bottom: 10px;margin-left: -150px;" id="msg"></div>

										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">排序:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${empty entity.sort?"0":entity.sort}" name="sort" id="sort"  placeholder="排序"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">浏览次数:<span style="color: red">*</span></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${empty entity.pageView?"0":entity.pageView}" name="pageView" id="pageView"  placeholder="浏览次数"/>
											</div>
										</div>

									</div>
								</div>
								<div class="row">
									<div class="col-md-12 col-sm-12 col-xs-12" >
										<div class="form-group">
											<label class="col-md-1 col-sm-1 col-xs-1 control-label">seoTitle:</label>
											<div class="col-md-11 col-sm-11 col-xs-11">
												<input type="text" class="form-control input-sm" value="${entity.seoTitle}" name="seoTitle" id="seoTitle"  placeholder="seoTitle"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-1 col-sm-1 col-xs-1 control-label">seoKeyword:</label>
											<div class="col-md-11 col-sm-11 col-xs-11">
												<input type="text" class="form-control input-sm" value="${entity.seoKeyword}" name="seoKeyword" id="seoKeyword"  placeholder="seoKeyword"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-1 col-sm-1 col-xs-1 control-label">seoDescription:</label>
											<div class="col-md-11 col-sm-11 col-xs-11">
												<input type="text" class="form-control input-sm" value="${entity.seoDescription}" name="seoDescription" id="seoDescription"  placeholder="seoDescription"/>
											</div>
										</div>

										<div class="form-group">
											<label class="col-md-1 col-sm-1 col-xs-1 control-label">摘要:</label>
											<div class="col-md-11 col-sm-11 col-xs-11">
												<textarea rows="3" cols="90" name="description" id="description" class="form-control input-sm" >${entity.description}</textarea>
											</div>
										</div>

										<div class="form-group">
											<label class="col-md-1 col-sm-1 col-xs-1 control-label">描述：</label>
											<div class="col-md-11 col-sm-11 col-xs-11">
												<textarea id="content" name="content" style="width:100%; height: 150px; visibility: hidden;">${ entity.content }</textarea>
												您当前输入了 <span class="word_count">0</span>
												个文字。（字数统计包含纯文本、IMG、EMBED，不包含换行符，IMG和EMBED算一个文字。
											</div>
										</div>

									</div>
								</div>
							</form:form>
						</fieldset>
					</div>
				</div>
				<!-- End .content-box-content -->
			</div>
		</div>
		<!-- End #main-content -->
	</div>
<script type="text/javascript">
var result = 0;
var validateForm;

$(document).ready(function() {
	validateForm = $("#inputForm").validate({
		rules : {
			type : {
				required : true
			},
			title : {
				required : true
			},
			sort : {
				required : true,
                digits:true
			},
			status : {
				required : true
			},
            isRecommend : {
				required : true
			}
		},
		messages : {
			type : {
				required : "展会类别不能为空"
			},
			title : {
				required : "展会名称不能为空"
			},
			sort : {
				required : "排序不能为空",
                digits:"只能输入整数"
			},
			status : {
				required : "是否开启不能为空"
			},
            isRecommend : {
				required : "是否推荐不能为空"
			}
		},
		errorElement : "em",
		errorClass : "validate_error",
		submitHandler: function(form) { //通过之后回调
		},
		invalidHandler: function(form, validator) {
			return false;
		}
	});
	
	
	//初始在线编辑器
    ShowEditorHtml("#content", "word_count");

	
	$("#uploadImage").imageUploadUtils({
		data : "#filedata",
		ext : "#fileext",
		msg : "#msg",
		preview : "#uploadPreview",
	});
	
	var photo = "${entity.photo}";
	var bg = "resource/images/header.png";
	if(photo!=''){
		bg = photo;
	}
	$("#uploadPreview").css("background-image", "url("+bg+")");
});

</script>	
</body>
<!-- Download From www.exet.tk-->
</html>